//
//  ChainMineTableCell.m
//  Chain
//
//  Created by zhaosh on 2018/4/11.
//  Copyright © 2018年 zhaosh. All rights reserved.
//

#import "ChainMineTableCell.h"
@interface ChainMineTableCell ()
@property (nonatomic,strong) UILabel *titleNameLb;
@property (nonatomic,strong) UIView *aboveView;
@property (nonatomic,strong) UIView *grayLb;
@end
@implementation ChainMineTableCell

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *identifier = @"ChainMineTableCell";
    ChainMineTableCell *cell = (ChainMineTableCell*)[tableView dequeueReusableCellWithIdentifier:identifier];
    if (cell == nil){
        cell = [[ChainMineTableCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
    }
    return cell;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = [UIColor clearColor];
        [self setContentView];
    }
    return self;
}

- (void)setContentView{
    self.aboveView = [[UIView alloc]init];
    self.aboveView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.aboveView];
    
    self.titleNameLb = [[UILabel alloc]init];
    self.titleNameLb.textAlignment = NSTextAlignmentLeft;
    self.titleNameLb.textColor = [UIColor colorWithHexString:@"#333333"];
    self.titleNameLb.font =[UIFont systemFontOfSize:15.0];
    [self.aboveView addSubview:self.titleNameLb];
    
    self.grayLb = [[UIView alloc]init];
    self.grayLb.backgroundColor = FINELINECOLOR;
    [self.aboveView addSubview:self.grayLb];
   
}

-(void)layoutSubviews{
    [super layoutSubviews];
  
    self.aboveView.frame = CGRectMake(0, 0, ScreenWidth, self.height);
    self.titleNameLb.frame =CGRectMake(30, 20, 200, 20);
    self.grayLb.frame = CGRectMake(0, self.height - 0.5, self.aboveView.width, 0.5);
    
    self.titleNameLb.text=self.item.tileName;
 
}
@end
